import request from '@/utils/request';
import { parseStrEmpty } from '@/utils/ruoyi';

// 查询用户列表
export function listTeacher(query) {
  return request({
    url: '/system/externalTeacher/list',
    method: 'get',
    params: query,
  });
}
// 查询社团
export function getOrgList(query) {
  return request({
    url: '/committee/org/getClubList/' +query,
    method: 'get',
  });
}

// 新增外聘教师
export function addTeacher(data) {
    return request({
      url: '/system/externalTeacher',
      method: 'post',
      data: data,
    });
  }
// 审核外聘教师
export function actTeacher(data) {
    return request({
      url: '/system/externalTeacher/examine',
      method: 'post',
      data: data,
    });
  }
// 新增外聘教师
export function getTeacher(id) {
    return request({
      url: '/system/externalTeacher/' + id,
      method: 'get',
    });
  }
// 修改外聘教师
export function updateTeacher(data) {
    return request({
      url: '/system/externalTeacher',
      method: 'put',
      data
    });
  }

  // 删除外聘老师
export function delTeacher(userId) {
    return request({
      url: '/system/externalTeacher/' + userId,
      method: 'delete',
    });
  }